package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the CONTROLLERSECURITY database table.
 * 
 */
@Embeddable
public class ControllersecurityPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String controllerclass;
	private String groupname;

    public ControllersecurityPK() {
    }

	@Column(unique=true, nullable=false, length=128)
	public String getControllerclass() {
		return this.controllerclass;
	}
	public void setControllerclass(String controllerclass) {
		this.controllerclass = controllerclass;
	}

	@Column(unique=true, nullable=false, length=10)
	public String getGroupname() {
		return this.groupname;
	}
	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ControllersecurityPK)) {
			return false;
		}
		ControllersecurityPK castOther = (ControllersecurityPK)other;
		return 
			this.controllerclass.equals(castOther.controllerclass)
			&& this.groupname.equals(castOther.groupname);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.controllerclass.hashCode();
		hash = hash * prime + this.groupname.hashCode();
		
		return hash;
    }
}